package ch10_thread.thread;

/**
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class CreateStartAndRun {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            System.out.println(Thread.currentThread().getName());
        });
        // 只是方法调用
        // thread.run();
        // 启动新线程；准备工作（就绪状态、等待cup资源）；不能重复start方法
        thread.start();
        // Exception in thread "main" java.lang.IllegalThreadStateException
        // thread.start();
    }
}
